<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Person(){
        this.name ='默认的名称';
        this.username ='这是自身的属性';
        this.show =function(){
            console.log("实例方法");
            
        }
    }
    Person.prototype.username = '这是通过原型对象添加的属性';
    let zs = new Person();
    console.log(zs.username);

    Person.prototype.showName = function(){
        console.log('这是在原型对象上添加的方法');
        
    }
    zs.showName();
    console.log('zs =',zs);
    console.log(zs.__proto__ == Person.prototype);

    Object.prototype.age = 99;
    console.log( 'zs.age =',zs.age);

    let ww = {};
    console.log('ww.age =',ww.age);
    

   
    
    




</script>
</html>